home *** CD-ROM | disk | FTP | other *** search
- /*************************************************************************/
- /* Name : AmiUp.rexx Version : 2.0 */
- /* Autor : Peter Meyer Stand : 25.02.95 */
- /* */
- /* $VER: AmiUp.rexx 2.0 © Peter Meyer (25.02.95) */
- /* */
- /* Zweck : Automatic upload of AmiNet files for DLG BBS's. File areas */
- /* and file comment are taken from the apropriate *.readme. */
- /* */
- /* Usage : 'Sys:RexxC/Rx AmiUp.rexx [Batch]' */
- /* */
- /* The BATCH option forces AmiUp not to use any requesters, */
- /* when the area or the comment couldn't be set correctly, */
- /* default values are used. */
- /* */
- /* Successfully uploaded files will be deleted from the source */
- /* directory. */
- /* */
- /* Comm. : The script uses the rexxreqtools.library by Nico Francois */
- /* the Areas need to be adapted to your BBS configuration. */
- /* */
- /* Bug Reports, problems, tips and suggestions to: */
- /* Peter Meyer FIDO: 2:246/1416.2 or peter@amiuni.tynet.sub.org */
- /* */
- /*************************************************************************/
-
- DefDir = "Ram:" /* Default directory to scan files from */
- DefDesc = "No discription found" /* Default filecomment */
-
- /************************* File Area configuration ***********************/
- /* */
- /* Attention: Fill in the correct number of the apropriate file area for */
- /* your BBS ! */
- /* */
- /* File area none will be used if AmiUp can't determine the */
- /* aproriate area in BATCH mode. */
- /* */
- /*************************************************************************/
-
- none = "1"; recent = "1"; new = "1"
-
- biz_dbase = "1"; biz_demo = "4"; biz_misc = "1"; biz_patch = "34"
-
- comm_bbs = "6"; comm_cnet = "6"; comm_dlg = "100"; comm_envoy = "31"
- comm_fido = "6"; comm_mail = "6"; comm_misc = "6"; comm_net = "31"
- comm_news = "6"; comm_term = "6"; comm_ums = "6"; comm_uucp = "6"
- comm_bbs_dlg = "100"
-
- demo_aga = "2"; demo_euro = "2"; demo_mag = "2"; demo_mega = "2"
- demo_slide = "2"; demo_sound = "2"; demo_tg93 = "2"
-
- dev_amos = "10"; dev_asm = "10"; dev_basic = "10"; dev_c = "10"
- dev_cross = "10"; dev_debug = "10"; dev_e = "10"; dev_gcc = "10"
- dev_gui = "10"; dev_lang = "10"; dev_m2 = "10"; dev_misc = "10"
- dev_moni = "10"; dev_obero = "10"; dev_src = "10"
-
- disk_bakup = "3"; disk_cache = "3"; disk_cdrom = "3"; disk_misc = "3"
- disk_moni = "3"; disk_optim = "3"; disk_salv = "3";
-
- docs_anno = "21"; docs_help = "21"; docs_hyper = "21"; docs_mags = "7"
- docs_misc = "21"; docs_rview = "14"
-
- fish_docs = "21"
-
- game_2play = "8"; game_demo = "4"; game_gag = "8"; game_hint = "8"
- game_jump = "8"; game_misc = "8"; game_patch = "8"; game_role = "8"
- game_shoot = "8"; game_think = "8"; games_gag = "8"
-
- gfx_3d = "26"; gfx_3dobj = "1"; gfx_aga = "26"; gfx_anim = "1"
- gfx_board = "26"; gfx_conv = "26"; gfx_edit = "26"; gfx_fract = "1"
- gfx_misc = "26"; gfx_pbm = "26"; gfx_show = "26"; gfx_x11 = "1"
-
- hard_drivr = "1"; hard_hack = "35"; hard_misc = "1"
-
- info_adt = "1"; info_sites = "1"; info_start = "1"; info_stats = "1"
-
- misc_amag = "25"; misc_antiq = "1"; misc_edu = "1"; misc_emu = "30"
- misc_math = "1"; misc_misc = "1"; misc_sci = "1"; misc_unix = "1"
-
- mods_8voic = "22"; mods_abc = "22"; mods_chart = "22"; mods_def = "22"
- mods_ghi = "22"; mods_jkl = "22"; mods_mno = "22"; mods_med = "22"
- mods_misc = "22"; mods_pqr = "22"; mods_pro = "22"; mods_spark = "22"
- mods_st = "22"; mods_stu = "22"; mods_vwx = "22"
-
- mus_edit = "5"; mus_midi = "1"; mus_misc = "1"; mus_play = "5"
- mus_smpl = "22"
-
- pix_bill = "1"; pix_guard = "1"; pix_icon = "1"; pix_illu = "1"
- pix_irc = "1"; pix_misc = "1"; pix_trace = "1"; pix_wb = "1"
-
- text_dtp = "27"; text_font = "27"; text_hyper = "1"; text_misc = "1"
- text_print = "1"; text_show = "3"; text_tex = "27"
-
- util_app = "16"; util_arc = "9"; util_batch = "3"; util_boot = "3"
- util_blank = "3"; util_cdity = "18"; util_cli = "3"; util_conv = "3"
- util_crypt = "3"; util_dir = "3"; util_edit = "3"; util_gnu = "3"
- util_libs = "3"; util_misc = "3"; util_moni = "3"; util_mouse = "3"
- util_pack = "9"; util_rexx = "17"; util_shell = "3"; util_virus = "28"
- util_wb = "12"
-
- /***************************** Main program ******************************/
-
- parse arg Batch
- if upper(Batch) = "BATCH" then Batch = 1
- else Batch = 0
-
- options results
-
- if ~show('L', 'rexxsupport.library') then do
- call addlib('rexxsupport.library', 0, -30, 0)
- end
- if ~show('L', 'rexxreqtools.library') then do
- call addlib('rexxreqtools.library', 0, -30, 0)
- end
-
- call GetFileList
-
- CommFiles = 0; UpFiles = 0; Dupes = 0
- do FileNumber = 1 to Files.count
- FileName = Files.FileNumber; DestName = FileName
- if right(FileName, 7) ~= ".readme" then do
- PointPos = lastpos(".", FileName)
- if PointPos ~= 0 then DestName = substr(FileName, 1, PointPos - 1)
- call CheckSize
- call CommentFile
- call UploadFile
- end
- end
- say "Selected : "||Files.count
- say "Uloaded : "||UpFiles
- say "Commented : "||CommFiles
- say "Dupes : "||Dupes
-
- if ~Batch then call DeleteList()
-
- exit
-
- /************************** Get List of Files ****************************/
-
- GetFileList:
- if ~Batch then do
- call MakeList() /* create area list */
- call rtfilerequest(DefDir,,"Select files",, "rtfi_flags=freqf_multiselect", Files)
- if Files = "0" then do
- say "Abort: No files selected !"
- call DeleteList()
- exit
- end
- call rtfreefilebuffer()
- end
- if Batch then do
- address command "List QUICK NOHEAD FILES >T:Files.lst"
- call open(FileLst, "T:Files.lst")
- FileNumber = 1
- do while ~eof(FileLst)
- Line = readln(FileLst)
- if Line ~= "" then do
- Files.FileNumber = Line
- FileNumber = FileNumber + 1
- end
- end
- Files.count = FileNumber - 1
- end
- return
-
- /**************************** Check File Size ****************************/
-
- CheckSize:
- FileInfo = statef(FileName); Free = ""
- if value(subword(FileInfo, 2, 1)) > 409600 then Free = "FREE"
- return
-
- /****************************** Comment File *****************************/
-
- CommentFile:
- FileDesc = DefDesc; AmiArea = "none"; ReadFound = 0
- ReadName = DestName||".readme"
- if exists(ReadName) then do
- ReadFound = 1
- call open(ReadMe, ReadName)
- do while ~eof(ReadMe)
- Line = readln(ReadMe)
- if left(Line, 6) = "Short:" then do
- FileDesc = compress(strip(substr(Line, 7)), '"''')
- CommFiles = CommFiles + 1
- Line = readln(ReadMe)
- end
- if left(Line, 5) = "Type:" then do
- AmiArea = translate(strip(subword(Line, 2, 1)), "_", "/")
- end
- if FileDesc ~= DefDesc & AmiArea ~= "none" then leave
- end
- call close(ReadMe)
- end
- return
-
- /******************************* Upload File *****************************/
-
- UploadFile:
- if ~datatype(value(AmiArea), N) then AmiArea = "none"
- if ~Batch & AmiArea = "none" then
- do
- say 'Select area for '||FileName||' : '||FileDesc
- UpArea = PickList(FileName)
- if FileDesc = DefDesc then FileDesc = GetFileDesc(FileName, DefDesc)
- say 'DLGUpload '||FileName||' -a '||UpArea||' -d '||'"'FileDesc'"'||' -u '"'Peter Meyer'"' '||Free
- address command 'DLG:DLGUpload -f '||FileName||' -a '||UpArea||' -d '||'"'FileDesc'"'||' -u '"'Peter Meyer'"' '||Free
- if RC ~= 0 then
- Dupes = Dupes + 1
- else do
- UpFiles = UpFiles + 1
- call delete(FileName)
- if ReadFound = 1 then call delete(ReadName)
- end
- end
- else
- do
- say 'DLGUpload '||FileName||' -a '||value(AmiArea)||' -d '||'"'FileDesc'"'||' -u '"'Peter Meyer'"' '||Free
- address command 'DLG:DLGUpload -f '||FileName||' -a '||value(AmiArea)||' -d '||'"'FileDesc'"'||' -u '"'Peter Meyer'"' '||Free
- if RC ~= 0 then
- Dupes = Dupes + 1
- else do
- UpFiles = UpFiles + 1
- call delete(FileName)
- if ReadFound = 1 then call delete(ReadName)
- end
- end
- return
-
- /**************************** File description ***************************/
-
- GetFileDesc: procedure
- parse arg FileName, DefDesc
- Separator = lastpos("/", FileName)
- if Separator = 0 then Separator = lastpos(":", FileName)
- UFName = substr(FileName, Separator + 1)
- FileDesc = rtgetstring(DefDesc,, "Description of "||UFName,,, Res)
- FileDesc = compress(FileDesc, '"''')
- if Res = 0 then FileDesc = DefDesc
- return FileDesc
-
- /****************************** List Requester ***************************/
- /* */
- /* Attention: You have to customize that part of the script ! */
- /* */
- /*************************************************************************/
-
- MakeList:
- call NewList()
- call AddList("001 Uploads")
- call AddList("002 Amiga-Demos")
- call AddList("003 Amiga-Utilities")
- call AddList("004 Amiga-Demos (Commerziell)")
- call AddList("005 Amiga-Musik Programme")
- call AddList("006 Amiga-Dfue")
- call AddList("007 Amiga-Magazine")
- call AddList("008 Amiga-Spiele")
- call AddList("009 Amiga-Packer")
- call AddList("010 Amiga-Programmer")
- call AddList("011 Amiga-MUI Anwendungen")
- call AddList("012 Amiga-Workbench")
- call AddList("013 Amiga-Drucker")
- call AddList("014 Amiga-Reviews")
- call AddList("015 Amiga-Gagprogramme")
- call AddList("016 Amiga-Anwendungen")
- call AddList("017 Amiga-ARexx")
- call AddList("018 Amiga-Commodities")
- call AddList("021 Amiga-Texte")
- call AddList("022 Amiga-Modules")
- call AddList("023 Amiga-Benchmarks")
- call AddList("025 Amiga-Disks")
- call AddList("026 Amiga-Grafik")
- call AddList("027 Amiga-TeX Dtp")
- call AddList("028 Amiga-Viren")
- call AddList("029 Amiga-Animationen")
- call AddList("030 Amiga-Emulationen")
- call AddList("031 Amiga-Netzwerke")
- call AddList("033 Amiga-Contents Files")
- call AddList("034 Amiga-Updates Patches")
- call AddList("035 Amiga-Hardware Bauanleiungen")
- call AddList("036 Amiga-Spieletips")
- call AddList("039 Amiga-AmiNet unsortiert")
- call AddList("040 MPEG-Animationen")
- call AddList("090 FIDO-Nodediffs")
- call AddList("091 FIDO-Region 24")
- call AddList("100 DLG-Utilities")
- call AddList("101 DLG-Updates")
- call AddList("102 DLG-Programmers_Support")
- call AddList("103 DLG-DLGMail_Support")
- call AddList("104 DLG-SkyUtilities_Support")
- call AddList("105 DLG-Doors OnlineGames")
- call AddList("110 MISC-Filelisten")
- call AddList("111 MISC-AmiUni Infos")
- call AddList("112 MISC-Bilder (Adult)")
- call AddList("113 MISC-Bilder (IFF GIF TIFF)")
- call AddList("115 MISC-Userbilder")
- call AddList("116 SIRDS")
- call AddList("117 Jupiter")
- call AddList("201 Picasso")
- call AddList("250 HP48")
- call AddList("301 Proxity.beta")
- return
-
- NewList: procedure
- address command 'MakeDir T:TempList >NIL:'
- return
-
- DeleteList: procedure
- address command 'Delete T:TempList ALL QUIET'
- return
-
- AddList: procedure
- parse arg Name
- address command 'Echo "" NOLINE >"T:TempList/'Name'"'
- return
-
- PickList: procedure
- parse arg FileName
- Separator = lastpos("/", FileName)
- if Separator = 0 then Separator = lastpos(":", FileName)
- UFName = substr(FileName, Separator + 1)
- UpArea = rtfilerequest("T:TempList","001 Uploads","Select area for "UFName,, "rtfi_flags=0", Res)
- if Res = 0 then
- UpArea = "1"
- else
- UpArea = strip(left(substr(UpArea, 12), 3), L, "0")
-
- return UpArea
-
-